import tkinter as tk
from PIL import ImageTk, Image
from login import *
from signup import *

class init():
    def __init__(self, master=None):
        self.window = master
        self.window.geometry('875x745')
        self.create_page()

    def create_page(self):
        self.page = tk.Frame(self.window, width=875, height=745)
        self.page.pack()
        img = Image.open('shrem1.png')
        self.image = ImageTk.PhotoImage(img)
        label_img = tk.Label(self.page, image=self.image)
        label_img.pack()
        tk.Button(self.page, text='管理员登录', font=('楷体', 30), bg='CornflowerBlue', fg='Moccasin', command=self.administrator_login).place(x=80, y=500)
        tk.Button(self.page, text='访客登录', font=('楷体', 30), bg='CornflowerBlue', fg='Moccasin', command=self.visitor_login).place(x=360, y=500)
        tk.Button(self.page, text='注册', font=('楷体', 30), bg='CornflowerBlue', fg='Moccasin', command=self.visitor_signup).place(x=600, y=500)

    def administrator_login(self):
        self.page.destroy()
        adminiLoginPage(self.window)

    def visitor_login(self):
        self.page.destroy()
        visitorLoginPage(self.window)

    def visitor_signup(self):
        visitorSignup()
